import {Component, OnInit} from '@angular/core';
declare var $: any;
@Component({
  selector: 'app-sidebar',
  templateUrl: './sidebar.component.html',
  styleUrls: ['./sidebar.component.scss']
})
export class SidebarComponent implements OnInit {

  constructor() {
  }

  ngOnInit() {
    $(function () {
      $('#side-menu').metisMenu();
    })
    $(window).resize(function () {
      let width: number;
      width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
      if (width < 768) {
        $('div.navbar-collapse').addClass('collapse');
      } else {
        $('div.navbar-collapse').removeClass('collapse');
      }
    })
    $(window).trigger('resize');
  }

}
